package com.hsgene.commit.domain;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.hsgene.common.util.date.TimeJsonDeserializer;

import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * 评论信息实体类
 *
 * @Author: wangxuefeng@hsgene.com
 * @Description:
 * @Date: Created in 11:13 2018/7/5
 * @Modified By:
 */
@Table(name = "geneshop_commit_info")
public class CommitInfo implements Serializable {
    /**
     * 评论表id
     */
    @Id
    private String id;
    /**
     * 评论商品id
     */
    private String productId;
    /**
     * 评论内容
     */
    private String content;
    /**
     * 图片(json串)
     */
    private String images;
    /**
     * 是否匿名
     */
    private String isAnonymous;
    /**
     * 买家id
     */
    private String userId;
    /**
     * 评论打分
     */
    private double commitSumScore;
    /**
     * 评论打星
     */
    private double commitStartCount;
    /**
     * 订单id
     */
    private String orderId;

    /**
     * 评论创建时间
     */
    @JsonDeserialize(using = TimeJsonDeserializer.class)
    private Date createTime = new Date();
    /**
     * 是否删除(逻辑删除)
     */
    private int isDelete;

    /**
     * 评价等级
     */
    private String commitRank;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getImages() {
        return images;
    }

    public void setImages(String images) {
        this.images = images;
    }

    public String getIsAnonymous() {
        return isAnonymous;
    }

    public void setIsAnonymous(String isAnonymous) {
        this.isAnonymous = isAnonymous;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public double getCommitSumScore() {
        return commitSumScore;
    }

    public void setCommitSumScore(double commitSumScore) {
        this.commitSumScore = commitSumScore;
    }

    public double getCommitStartCount() {
        return commitStartCount;
    }

    public void setCommitStartCount(double commitStartCount) {
        this.commitStartCount = commitStartCount;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public int getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(int isDelete) {
        this.isDelete = isDelete;
    }

    public String getCommitRank() {
        return commitRank;
    }

    public void setCommitRank(String commitRank) {
        this.commitRank = commitRank;
    }

    @Override
    public String toString() {
        return "CommitInfo{" +
                "id='" + id + '\'' +
                ", productId='" + productId + '\'' +
                ", content='" + content + '\'' +
                ", images='" + images + '\'' +
                ", isAnonymous='" + isAnonymous + '\'' +
                ", userId='" + userId + '\'' +
                ", commitSumScore=" + commitSumScore +
                ", commitStartCount=" + commitStartCount +
                ", orderId='" + orderId + '\'' +
                ", createTime=" + createTime +
                ", isDelete=" + isDelete +
                ", commitRank='" + commitRank + '\'' +
                '}';
    }
}
